<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" />
<title>Tutorial:Callback Functions - LOVE</title>
<meta name="generator" content="MediaWiki 1.24.2" />
<link rel="ExportRDF" type="application/rdf+xml" title="Tutorial:Callback Functions" href="" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="opensearch_desc.php" title="LOVE (en)" />
<link rel="EditURI" type="application/rsd+xml" href="api.php_action_rsd" />
<link rel="alternate" hreflang="x-default" href="" />
<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html" />
<link rel="alternate" type="application/atom+xml" title="LOVE Atom feed" href="" />
<link rel="stylesheet" href="" />
<!--[if IE 6]><link rel="stylesheet" href="ie60fixes.css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="ie70fixes.css" media="screen" /><![endif]--><meta name="ResourceLoaderDynamicStyles" content="" />
<link rel="stylesheet" href="" />
<style>a:lang(ar),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}
/* cache key: love2d_wiki:resourceloader:filter:minify-css:7:daf253d59690fd9cabb6b95510bce103 */</style>
<script src=""></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"Tutorial","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":500,"wgPageName":"Tutorial:Callback_Functions","wgTitle":"Callback Functions","wgCurRevisionId":24823,"wgRevisionId":24823,"wgArticleId":495,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Tutorials"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"Tutorial:Callback_Functions","wgIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function($,jQuery){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"editfont":"default","editondblclick":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":1,"extendwatchlist":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nickname":"","norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"rcdays":7,"rclimit":50,"rows":25,"showhiddencats":0,"shownumberswatching":1,"showtoolbar":1,"skin":"love","stubthreshold":0,"thumbsize":5,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":1,"watchdefault":1,"watchdeletion":0,"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"watchrollback":0,
"wllimit":250,"useeditwarning":1,"prefershttps":1,"language":"en","variant-gan":"gan","variant-iu":"iu","variant-kk":"kk","variant-ku":"ku","variant-shi":"shi","variant-sr":"sr","variant-tg":"tg","variant-uz":"uz","variant-zh":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"searchNs102":false,"searchNs103":false,"searchNs104":false,"searchNs105":false,"searchNs108":false,"searchNs109":false,"searchNs500":false,"searchNs501":false,"variant":"en"});},{},{});mw.loader.implement("user.tokens",function($,jQuery){mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\"});},{},{});
/* cache key: love2d_wiki:resourceloader:filter:minify-js:7:201bb6cc0b4c032fe7bbe209a0125541 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax","ext.smw.style"]);
}</script>
</head>
<body class="mediawiki ltr sitedir-ltr ns-500 ns-subject page-Tutorial_Callback_Functions skin-love action-view">
<div id="globalWrapper">
		<div id="column-content">
			<div id="content" class="mw-body" role="main">
				<a id="top"></a>
				
				
						<div id="p-cactions" role="navigation">
			<h5>Views</h5>

			<div>
				<ul>
				<li id="ca-nstab-tutorial" class="selected"><a href="">Tutorial</a></li>
				<li id="ca-talk"><a href="tutorial_talk_callback_functions.html" title="Discussion about the content page [t]" accesskey="t">Discussion</a></li>
				<li id="ca-viewsource"><a href="" title="This page is protected.&#10;You can view its source [e]" accesskey="e">View source</a></li>
				<li id="ca-history"><a href="" rel="archives" title="Past revisions of this page [h]" accesskey="h">History</a></li>
				</ul>
							</div>
		</div>
	
				<h1 id="firstHeading" class="firstHeading" lang="en">Tutorial:Callback Functions</h1>

				<div id="bodyContent">
					<!-- <div id="siteSub">From LOVE</div> -->

					<!-- <div id="contentSub"></div> -->
										<!-- <div id="jump-to-nav" class="mw-jump">Jump to: <a href="#column-one">navigation</a>, <a href="#searchInput">search</a></div> -->

					<!-- start content -->
					<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><p>The <a href="category_callbacks.html" title="Category:Callbacks">callback</a> functions in LÖVE are called by <a href="love51.html" title="love.run">love.run</a> to perform various tasks and are all optional. However, a fully-featured game experience would probably utilize nearly all of them, so it's wise to know what they are.
</p><p>A callback, for those new to programming or otherwise unfamiliar with the term, is a function which works backwards in a sense. In a regular function like <a href="love.graphics46.html" title="love.graphics.draw">love.graphics.draw</a> or math.floor, you call it and LÖVE or Lua does something. A callback, on the other hand, is a function that you code and LÖVE calls at certain times. This makes it easy to keep your code organized and optimal. For example, since love.load will only get called once when the game is first started (before any other callback), it's a fine place to put code which loads game content and otherwise prepares things.
</p>
<h2><span class="mw-headline" id="love.load"><a href="love56.html" title="love.load">love.load</a></span></h2>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>load<span class="br0">&#40;</span><span class="br0">&#41;</span>
   image <span class="sy0">=</span> love<span class="sy0">.</span>graphics<span class="sy0">.</span>newImage<span class="br0">&#40;</span><span class="st0">&quot;cake.jpg&quot;</span><span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span>setNewFont<span class="br0">&#40;</span><span class="nu0">12</span><span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span>setColor<span class="br0">&#40;</span><span class="nu0">0</span><span class="sy0">,</span><span class="nu0">0</span><span class="sy0">,</span><span class="nu0">0</span><span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span>setBackgroundColor<span class="br0">&#40;</span><span class="nu0">255</span><span class="sy0">,</span><span class="nu0">255</span><span class="sy0">,</span><span class="nu0">255</span><span class="br0">&#41;</span>
<span class="kw1">end</span></pre></div></div>
<p>This function gets called only once, when the game is started, and is usually where you would load resources, initialize variables and set specific settings. All those things can be done anywhere else as well, but doing them here means that they are done once only, saving a lot of system resources. 
</p>
<h2><span class="mw-headline" id="love.update"><a href="love52.html" title="love.update">love.update</a></span></h2>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>update<span class="br0">&#40;</span>dt<span class="br0">&#41;</span>
   <span class="kw1">if</span> love<span class="sy0">.</span>keyboard<span class="sy0">.</span>isDown<span class="br0">&#40;</span><span class="st0">&quot;up&quot;</span><span class="br0">&#41;</span> <span class="kw1">then</span>
      num <span class="sy0">=</span> num <span class="sy0">+</span> <span class="nu0">100</span> <span class="sy0">*</span> dt <span class="co1">-- this would increment num by 100 per second</span>
   <span class="kw1">end</span>
<span class="kw1">end</span></pre></div></div>
<p>This function is called continuously and will probably be where most of your math is done. 'dt' stands for "<a href="love.timer1.html" title="love.timer.getDelta">delta time</a>" and is the amount of seconds since the last time this function was called (which is usually a small value like 0.025714). 
</p>
<h2><span class="mw-headline" id="love.draw"><a href="love53.html" title="love.draw">love.draw</a></span></h2>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>draw<span class="br0">&#40;</span><span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span>draw<span class="br0">&#40;</span>image<span class="sy0">,</span> imgx<span class="sy0">,</span> imgy<span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span><span class="kw3">print</span><span class="br0">&#40;</span><span class="st0">&quot;Click and drag the cake around or use the arrow keys&quot;</span><span class="sy0">,</span> <span class="nu0">10</span><span class="sy0">,</span> <span class="nu0">10</span><span class="br0">&#41;</span>
<span class="kw1">end</span></pre></div></div>
<p><code><a href="love53.html" title="love.draw">love.draw</a></code> is where all the drawing happens (if that wasn't obvious enough already) and if you call any of the <code><a href="love.graphics46.html" title="love.graphics.draw">love.graphics.draw</a></code> outside of this function then it's not going to have any effect. This function is also called continuously so keep in mind that if you change the font/color/mode/etc at the end of the function then it will have a effect on things at the beginning of the function. For example: 
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>load<span class="br0">&#40;</span><span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span>setColor<span class="br0">&#40;</span><span class="nu0">0</span><span class="sy0">,</span><span class="nu0">0</span><span class="sy0">,</span><span class="nu0">0</span><span class="br0">&#41;</span>
<span class="kw1">end</span>
&#160;
<span class="kw1">function</span> love<span class="sy0">.</span>draw<span class="br0">&#40;</span><span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span><span class="kw3">print</span><span class="br0">&#40;</span><span class="st0">&quot;This text is not black because of the line below&quot;</span><span class="sy0">,</span> <span class="nu0">100</span><span class="sy0">,</span> <span class="nu0">100</span><span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span>setColor<span class="br0">&#40;</span><span class="nu0">255</span><span class="sy0">,</span><span class="nu0">0</span><span class="sy0">,</span><span class="nu0">0</span><span class="br0">&#41;</span>
   love<span class="sy0">.</span>graphics<span class="sy0">.</span><span class="kw3">print</span><span class="br0">&#40;</span><span class="st0">&quot;This text is red&quot;</span><span class="sy0">,</span> <span class="nu0">100</span><span class="sy0">,</span> <span class="nu0">200</span><span class="br0">&#41;</span>
<span class="kw1">end</span></pre></div></div>
<h2><span class="mw-headline" id="love.mousepressed"><a href="love46.html" title="love.mousepressed">love.mousepressed</a></span></h2>
<table class="new-section" bgcolor="#d0d0ff" style="margin-top: 1em; padding: 3px; border-radius:5px; -moz-border-radius:5px;" data-newin="&#91;&#91;0.10.0]]">
<tr>
<td><i> <b>Available since LÖVE <a href="0.102.html" title="0.10.0">0.10.0</a></b> </i>
</td></tr>
<tr>
<td> <small>This variant is not supported in earlier versions.</small>
</td></tr></table>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>mousepressed<span class="br0">&#40;</span>x<span class="sy0">,</span> y<span class="sy0">,</span> button<span class="sy0">,</span> istouch<span class="br0">&#41;</span>
   <span class="kw1">if</span> button <span class="sy0">==</span> <span class="nu0">1</span> <span class="kw1">then</span>
      imgx <span class="sy0">=</span> x <span class="co1">-- move image to where mouse clicked</span>
      imgy <span class="sy0">=</span> y
   <span class="kw1">end</span>
<span class="kw1">end</span></pre></div></div>
<p>This function is called whenever a mouse button is pressed and it receives the button and the coordinates of where it was pressed. The button can be any of the button index that was pressed. This function goes very well along with <code><a href="love47.html" title="love.mousereleased">love.mousereleased</a></code>.
</p>
<h2><span class="mw-headline" id="love.mousereleased"><a href="love47.html" title="love.mousereleased">love.mousereleased</a></span></h2>
<table class="new-section" bgcolor="#d0d0ff" style="margin-top: 1em; padding: 3px; border-radius:5px; -moz-border-radius:5px;" data-newin="&#91;&#91;0.10.0]]">
<tr>
<td><i> <b>Available since LÖVE <a href="0.102.html" title="0.10.0">0.10.0</a></b> </i>
</td></tr>
<tr>
<td> <small>This variant is not supported in earlier versions.</small>
</td></tr></table>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>mousereleased<span class="br0">&#40;</span>x<span class="sy0">,</span> y<span class="sy0">,</span> button<span class="sy0">,</span> istouch<span class="br0">&#41;</span>
   <span class="kw1">if</span> button <span class="sy0">==</span> <span class="nu0">1</span> <span class="kw1">then</span>
      fireSlingshot<span class="br0">&#40;</span>x<span class="sy0">,</span>y<span class="br0">&#41;</span> <span class="co1">-- this totally awesome custom function is defined elsewhere</span>
   <span class="kw1">end</span>
<span class="kw1">end</span></pre></div></div>
<p>This function is called whenever a mouse button is released and it receives the button and the coordinates of where it was released. You can have this function together with <code><a href="love46.html" title="love.mousepressed">love.mousepressed</a></code> or separate, they aren't connected in any way.
</p>
<h2><span class="mw-headline" id="love.keypressed"><a href="love32.html" title="love.keypressed">love.keypressed</a></span></h2>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>keypressed<span class="br0">&#40;</span>key<span class="br0">&#41;</span>
   <span class="kw1">if</span> key <span class="sy0">==</span> <span class="st0">'b'</span> <span class="kw1">then</span>
      text <span class="sy0">=</span> <span class="st0">&quot;The B key was pressed.&quot;</span>
   <span class="kw1">elseif</span> key <span class="sy0">==</span> <span class="st0">'a'</span> <span class="kw1">then</span>
      a_down <span class="sy0">=</span> <span class="kw4">true</span>
   <span class="kw1">end</span>
<span class="kw1">end</span></pre></div></div>
<p>This function is called whenever a keyboard key is pressed and receives the key that was pressed. The key can be any of the <a href="keyconstant.html" title="KeyConstant">constants</a>. This functions goes very well along with <code><a href="love33.html" title="love.keyreleased">love.keyreleased</a></code>.
</p>
<h2><span class="mw-headline" id="love.keyreleased"><a href="love33.html" title="love.keyreleased">love.keyreleased</a></span></h2>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>keyreleased<span class="br0">&#40;</span>key<span class="br0">&#41;</span>
   <span class="kw1">if</span> key <span class="sy0">==</span> <span class="st0">'b'</span> <span class="kw1">then</span>
      text <span class="sy0">=</span> <span class="st0">&quot;The B key was released.&quot;</span>
   <span class="kw1">elseif</span> key <span class="sy0">==</span> <span class="st0">'a'</span> <span class="kw1">then</span>
      a_down <span class="sy0">=</span> <span class="kw4">false</span>
   <span class="kw1">end</span>
<span class="kw1">end</span></pre></div></div>
<p>This function is called whenever a keyboard key is released and receives the key that was released. You can have this function together with <code><a href="love32.html" title="love.keypressed">love.keypressed</a></code> or separate, they aren't connected in any way. 
</p>
<h2><span class="mw-headline" id="love.focus"><a href="love57.html" title="love.focus">love.focus</a></span></h2>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>focus<span class="br0">&#40;</span>f<span class="br0">&#41;</span>
  <span class="kw1">if</span> <span class="kw2">not</span> f <span class="kw1">then</span>
    <span class="kw3">print</span><span class="br0">&#40;</span><span class="st0">&quot;LOST FOCUS&quot;</span><span class="br0">&#41;</span>
  <span class="kw1">else</span>
    <span class="kw3">print</span><span class="br0">&#40;</span><span class="st0">&quot;GAINED FOCUS&quot;</span><span class="br0">&#41;</span>
  <span class="kw1">end</span>
<span class="kw1">end</span></pre></div></div>
<p>This function is called whenever the user clicks off and on the LÖVE window. For instance, if they are playing a windowed game and a user clicks on his Internet browser, the game could be notified and automatically pause the game.
</p>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>focus<span class="br0">&#40;</span>f<span class="br0">&#41;</span> gameIsPaused <span class="sy0">=</span> <span class="kw2">not</span> f <span class="kw1">end</span>
&#160;
<span class="kw1">function</span> love<span class="sy0">.</span>update<span class="br0">&#40;</span>dt<span class="br0">&#41;</span>
	<span class="kw1">if</span> gameIsPaused <span class="kw1">then</span> <span class="kw1">return</span> <span class="kw1">end</span>
&#160;
	<span class="co1">-- The rest of your love.update code goes here</span>
<span class="kw1">end</span></pre></div></div>
<h2><span class="mw-headline" id="love.quit"><a href="love58.html" title="love.quit">love.quit</a></span></h2>
<div dir="ltr" class="mw-geshi mw-code mw-content-ltr"><div class="lua source-lua"><pre class="de1"><span class="kw1">function</span> love<span class="sy0">.</span>quit<span class="br0">&#40;</span><span class="br0">&#41;</span>
  <span class="kw3">print</span><span class="br0">&#40;</span><span class="st0">&quot;Thanks for playing! Come back soon!&quot;</span><span class="br0">&#41;</span>
<span class="kw1">end</span></pre></div></div>
<p>This function is called whenever the user clicks the window's close button (often an X). For instance, if the user decides they are done playing, they could click the close button. Then, before it closes, the game can save its state.
</p><p>Those are the callback functions and their basic usage.
</p><p><br />
</p>
<h2><span class="mw-headline" id="Other_languages">Other languages</span></h2>
<div class="i18n">
<p><a href="" class="new" title="Tutorial:Callback Functions (Dansk) (page does not exist)">Dansk</a>&#160;&#8211;
<a href="tutorial_callback_functions_deutsch.html" title="Tutorial:Callback Functions (Deutsch)">Deutsch</a>&#160;&#8211;
<strong class="selflink">English</strong>&#160;&#8211; 
<a href="tutorial_callback_functions_espa_ol.html" title="Tutorial:Callback Functions (Español)">Español</a>&#160;&#8211;
<a href="tutorial_callback_functions_fran_ais.html" title="Tutorial:Callback Functions (Français)">Français</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Indonesia) (page does not exist)">Indonesia</a>&#160;&#8211;
<a href="tutorial_callback_functions_italiano.html" title="Tutorial:Callback Functions (Italiano)">Italiano</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Lietuviškai) (page does not exist)">Lietuviškai</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Magyar) (page does not exist)">Magyar</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Nederlands) (page does not exist)">Nederlands</a>&#160;&#8211;
<a href="tutorial_callback_functions_polski.html" title="Tutorial:Callback Functions (Polski)">Polski</a>&#160;&#8211;
<a href="tutorial_callback_functions_portugu_s.html" title="Tutorial:Callback Functions (Português)">Português</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Română) (page does not exist)">Română</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Slovenský) (page does not exist)">Slovenský</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Suomi) (page does not exist)">Suomi</a>&#160;&#8211;
<a href="tutorial_callback_functions_svenska.html" title="Tutorial:Callback Functions (Svenska)">Svenska</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Türkçe) (page does not exist)">Türkçe</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Česky) (page does not exist)">Česky</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Ελληνικά) (page does not exist)">Ελληνικά</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Български) (page does not exist)">Български</a>&#160;&#8211;
<a href="tutorial_callback_functions2.html" title="Tutorial:Callback Functions (Русский)">Русский</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (Српски) (page does not exist)">Српски</a>&#160;&#8211;
<a href="tutorial_callback_functions3.html" title="Tutorial:Callback Functions (Українська)">Українська</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (עברית) (page does not exist)">עברית</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (ไทย) (page does not exist)">ไทย</a>&#160;&#8211;
<a href="tutorial_callback_functions1.html" title="Tutorial:Callback Functions (日本語)">日本語</a>&#160;&#8211;
<a href="" class="new" title="Tutorial:Callback Functions (正體中文) (page does not exist)">正體中文</a>&#160;&#8211;
<a href="tutorial_callback_functions4.html" title="Tutorial:Callback Functions (简体中文)">简体中文</a>&#160;&#8211;
<a href="tutorial_callback_functions_ti_ng_vi_t.html" title="Tutorial:Callback Functions (Tiếng Việt)">Tiếng Việt</a>&#160;&#8211;
<a href="tutorial_callback_functions5.html" title="Tutorial:Callback Functions (한국어)">한국어</a> 
<br />
<span style="text-align:right;"><i><a href="help_i18n.html" title="Help:i18n">More info</a></i></span>
</p>
</div>

<!-- 
NewPP limit report
CPU time usage: 0.116 seconds
Real time usage: 0.121 seconds
Preprocessor visited node count: 440/1000000
Preprocessor generated node count: 1147/1000000
Post‐expand include size: 4781/2097152 bytes
Template argument size: 2208/2097152 bytes
Highest expansion depth: 5/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key love2d_wiki:pcache:idhash:495-0!*!0!!*!*!* and timestamp 20210227162208 and revision id 24823
 -->
</div><div class="printfooter">
Retrieved from "<a dir="ltr" href="">http://love2d.org/w/index.php?title=Tutorial:Callback_Functions&amp;oldid=24823</a>"</div>
					<div id='catlinks' class='catlinks'><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="" title="Special:Categories">Category</a>: <ul><li><a href="category_tutorials.html" title="Category:Tutorials">Tutorials</a></li></ul></div></div>					<!-- end content -->
										<div class="visualClear"></div>
				</div>
			</div>
		</div>
		<div id="column-one">
			<div class="portlet" id="p-personal" role="navigation">
				<h5>Personal tools</h5>

				<div class="pBody">
					<ul>
													<li id="pt-login"><a href="" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o">Log in</a></li>
											</ul>
				</div>
			</div>
			<div class="portlet" id="p-logo" role="banner">
				<a href="index.html" class="mw-wiki-logo" title="Visit the main page"></a>
			</div>
				<div class="generated-sidebar portlet" id="p-documentation" role="navigation">
		<h5>documentation</h5>
		<div class='pBody'>
							<ul>
											<li id="n-love"><a href="love.html">love</a></li>
											<li id="n-love.audio"><a href="love1.html">love.audio</a></li>
											<li id="n-love.data"><a href="love2.html">love.data</a></li>
											<li id="n-love.event"><a href="love3.html">love.event</a></li>
											<li id="n-love.filesystem"><a href="love4.html">love.filesystem</a></li>
											<li id="n-love.font"><a href="love5.html">love.font</a></li>
											<li id="n-love.graphics"><a href="love6.html">love.graphics</a></li>
											<li id="n-love.image"><a href="love7.html">love.image</a></li>
											<li id="n-love.joystick"><a href="love8.html">love.joystick</a></li>
											<li id="n-love.keyboard"><a href="love9.html">love.keyboard</a></li>
											<li id="n-love.math"><a href="love10.html">love.math</a></li>
											<li id="n-love.mouse"><a href="love11.html">love.mouse</a></li>
											<li id="n-love.physics"><a href="love12.html">love.physics</a></li>
											<li id="n-love.sound"><a href="love13.html">love.sound</a></li>
											<li id="n-love.system"><a href="love14.html">love.system</a></li>
											<li id="n-love.thread"><a href="love15.html">love.thread</a></li>
											<li id="n-love.timer"><a href="love16.html">love.timer</a></li>
											<li id="n-love.touch"><a href="love17.html">love.touch</a></li>
											<li id="n-love.video"><a href="love18.html">love.video</a></li>
											<li id="n-love.window"><a href="love19.html">love.window</a></li>
											<li id="n-lua-enet"><a href="lua_enet.html">lua-enet</a></li>
											<li id="n-luasocket"><a href="socket.html">luasocket</a></li>
											<li id="n-utf8"><a href="utf8.html">utf8</a></li>
									</ul>
					</div>
		</div>
		<div class="generated-sidebar portlet" id="p-navigation" role="navigation">
		<h5>Navigation</h5>
		<div class='pBody'>
							<ul>
											<li id="n-Home"><a href="love2d1.html" rel="nofollow">Home</a></li>
											<li id="n-Forums"><a href="forums.html" rel="nofollow">Forums</a></li>
											<li id="n-Issue-tracker"><a href="https://github.com/love2d/love/issues" rel="nofollow">Issue tracker</a></li>
									</ul>
					</div>
		</div>
		<div class="generated-sidebar portlet" id="p-wiki_navigation" role="navigation">
		<h5>wiki navigation</h5>
		<div class='pBody'>
							<ul>
											<li id="n-mainpage-description"><a href="index.html" title="Visit the main page [z]" accesskey="z">Main page</a></li>
											<li id="n-recentchanges"><a href="" title="A list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li>
											<li id="n-randompage"><a href="" title="Load a random page [x]" accesskey="x">Random page</a></li>
									</ul>
					</div>
		</div>
			<div id="p-search" class="portlet" role="search">
			<h5><label for="searchInput">Search</label></h5>

			<div id="searchBody" class="pBody">
				<form action="w.html" id="searchform">
					<input type='hidden' name="title" value="Special:Search"/>
					<input type="search" name="search" placeholder="Search" title="Search LOVE [f]" accesskey="f" id="searchInput" />
					<input type="submit" name="go" value="Go" title="Go to a page with this exact name if exists" id="searchGoButton" class="searchButton" />&#160;
						<input type="submit" name="fulltext" value="Search" title="Search the pages for this text" id="mw-searchButton" class="searchButton" />
				</form>

							</div>
		</div>
			<div class="portlet" id="p-tb" role="navigation">
			<h5>Tools</h5>

			<div class="pBody">
				<ul>
											<li id="t-whatlinkshere"><a href="" title="A list of all wiki pages that link here [j]" accesskey="j">What links here</a></li>
											<li id="t-recentchangeslinked"><a href="" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li>
											<li id="t-specialpages"><a href="" title="A list of all special pages [q]" accesskey="q">Special pages</a></li>
											<li id="t-print"><a href="" rel="alternate" title="Printable version of this page [p]" accesskey="p">Printable version</a></li>
											<li id="t-permalink"><a href="" title="Permanent link to this revision of the page">Permanent link</a></li>
											<li id="t-info"><a href="">Page information</a></li>
									</ul>
							</div>
		</div>
			</div><!-- end of the left (by default at least) column -->
		<div class="visualClear"></div>
					<div id="footer" role="contentinfo">
						<div id="f-copyrightico">
									<a href="http://www.gnu.org/copyleft/fdl.html"><img src="gnu_fdl.png" alt="GNU Free Documentation License 1.3" width="88" height="31" /></a>
							</div>
					<div id="f-poweredbyico">
									<a href="http://www.mediawiki.org/"><img src="poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" width="88" height="31" /></a>
									<a href="https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki"><img src="smw_button.png" alt="Powered by Semantic MediaWiki" width="88" height="31" /></a>
							</div>
					<ul id="f-list">
									<li id="lastmod"> This page was last modified on 12 January 2020, at 23:43.</li>
									<li id="viewcount">This page has been accessed 229,339 times.</li>
									<li id="copyright">Content is available under <a class="external" rel="nofollow" href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License 1.3</a> unless otherwise noted.</li>
									<li id="privacy"><a href="love_privacy_policy.html" title="LOVE:Privacy policy">Privacy policy</a></li>
									<li id="about"><a href="love_about.html" title="LOVE:About">About LOVE</a></li>
									<li id="disclaimer"><a href="love_general_disclaimer.html" title="LOVE:General disclaimer">Disclaimers</a></li>
							</ul>
		</div>
		</div>
		<script>/*<![CDATA[*/window.jQuery && jQuery.ready();/*]]>*/</script><script>if(window.mw){
mw.loader.state({"site":"loading","user":"ready","user.groups":"ready"});
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.searchSuggest"],null,true);
}</script>
<script>if(window.mw){
document.write("\u003Cscript src=\"http://love2d.org/w/load.php?debug=false\u0026amp;lang=en\u0026amp;modules=site\u0026amp;only=scripts\u0026amp;skin=love\u0026amp;*\"\u003E\u003C/script\u003E");
}</script>
<script>if(window.mw){
mw.config.set({"wgBackendResponseTime":76});
}</script></body></html>
